package com.itheima.mapper;

import com.itheima.pojo.OrderSetting;
import org.apache.ibatis.annotations.Insert;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Select;
import org.apache.ibatis.annotations.Update;

import java.util.List;

@Mapper
public interface OrdersettingMapper {
    //根据日期蛇者预约数量
    @Insert("insert into t_ordersetting(orderDate,number,reservations)"
            + "values(#{orderDate},#{number},#{reservations})")
    void editNumberByOrderDate(OrderSetting orderSetting);


    //根据年月查询对应的预约设置信息
    List<OrderSetting> getOrderSettingByMonth(String month);

    // 批量添加预约设置信息 excle
    void add(OrderSetting orderSetting);

    //看所在日期是否存在
    @Select("select * from t_ordersetting where orderDate = #{date}")
    List<OrderSetting> findByDate(String date);
    //更新预约设置信息
    @Update("update t_ordersetting set number = #{number} where orderDate = #{orderDate}")
    void updateNumberByOrderDate(String orderDate , Integer number);

//    //根据日期查询预约设置信息
//    @Select("select * from t_ordersetting where orderDate = #{date}")
//    OrderSetting findByDate(Date date);
}
